<template>
    <div>
        <h3>我的总资产:{{ money }}</h3>
        <h4>是不是有钱人:</h4><input type="radio" :checked="flag">
        <h3>目前的状态:{{ money>=10000?'富人':'穷人' }}</h3>
        <span>消费项目:</span><button @click="show">洗脚60</button><button @click="eat">吃饭100</button><button @click="data">约会1000</button><button @click="song">送外卖+100</button>
    </div>
</template>

<script>
export default{
    name:'demo-anli',
    data(){
        return {
            money:10000,
            flag:true,

        }
    },
    methods:{
        fn(){
            if (this.money>=10000) {
                this.flag=true
            }else if(this.money<10000){
                this.flag=false
            }
        },
        show(){
            this.money-=60
            this.fn()
        },
        eat(){
            this.money-=100
            this.fn()
        },
        data(){
            this.money-=1000
            this.fn()
        },
        song(){
            this.money+=100
            this.fn()
        }
    }
}
</script>

<style lang="less">
    h4{
        display: inline-block;
    }
</style>